import {createRouter, createWebHistory} from "vue-router";

const Home = ()=>import("../views/Home/index.vue")
const Login = ()=>import("../views/Login/index.vue")
const Music = ()=>import("../views/Home/component/Music/index.vue")
const News = ()=>import("../views/Home/component/News/index.vue")
const MusicItem = ()=>import("../views/Home/component/Music/MusicItem.vue")
const NewsItem = ()=>import("../views/Home/component/News/NewsItem.vue")
const router = createRouter({
    history:createWebHistory(),
    routes:[
        {
            path:"/home",
            component:Home,
            name:"home",
            children:[
                {
                    path:"music",
                    component:Music,
                    name:"music",
                    children:[
                        {
                            path:"musicItem/:name/:order?",
                            component:MusicItem,
                            name:"musicItem"
                        }
                    ]
                },
                {
                    path:"news",
                    component:News,
                    name:"news",
                    children:[
                        {
                            path:"newsItem",
                            component:NewsItem,
                            name:"newsItem"
                        }
                    ]
                },
            ]
        },
        {
            path:"/login",
            component:Login,
            name:"login"
        },
    ]
})

export default router